<template>
  <div class="baseInfoWrap" v-loading="loading">
    <el-card class="cardWrap">
      <div slot="header" class="clearfix">
        <span>企业基本信息</span>
        <el-button
            @click="getInfo"
            style="float: right; padding: 6px 2px"
            type="primary"
            icon="el-icon-upload"
            v-if="hasAuth('VMS_ENTERPRISE_INFO_ADD')"
        >
          获取纳税人基本信息
        </el-button>
      </div>
      <div style="width: 100%">
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>纳税人名称 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.nsrmc }}</span> -->
              <popCom :content="detailInfo.nsrmc"/>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>纳税人识别号/统一社会信用代码 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.nsrsbh }}</span> -->
              <popCom :content="detailInfo.nsrsbh"  />
            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>登记序号 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.djxh }}</span> -->
              <popCom :content="detailInfo.djxh"/>

            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>税收档案编号 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.ssdabh }}</span> -->
              <popCom :content="detailInfo.ssdabh"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>纳税人类型标签 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.nsrlx }}</span> -->
              <popCom :content="detailInfo.nsrlx"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>生产经营地址 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.scjydz }}</span> -->
              <popCom :content="detailInfo.scjydz"/>

            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>注册地邮政编码 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.zcdyzbm }}</span> -->
              <popCom :content="detailInfo.zcdyzbm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>注册地联系电话 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.zcdlxdh }}</span> -->
              <popCom :content="detailInfo.zcdlxdh"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>法人名称（法定代表人姓名） ：</span>
              <!-- <span class="colorGray">{{ detailInfo.fddbrxm }}</span> -->
              <popCom :content="detailInfo.fddbrxm"/>

            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>登记注册类型（国标） ：</span>
              <!-- <span class="colorGray">{{ detailInfo.djzclxdm }}</span> -->
              <popCom :content="detailInfo.djzclxdm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>行业代码 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.hydm }}</span> -->
              <popCom :content="detailInfo.hydm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>企业行业性质 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.qyhyxzdm }}</span> -->
              <popCom :content="detailInfo.qyhyxzdm"/>

            </div>
          </el-col>
        </el-row>
      </div>
    </el-card>
    <el-card class="cardWrap">
      <div slot="header" class="clearfix">
        <span>企业税务信息</span>
      </div>
      <div style="width: 100%">
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>区县级税务机关代码 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.qxjswjgdm }}</span> -->
              <popCom :content="detailInfo.qxjswjgdm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>税务机关代码 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.zgswskfjdm }}</span> -->
              <popCom :content="detailInfo.zgswskfjdm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>税务机关名称 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.zgswskfjmc }}</span> -->
              <popCom :content="detailInfo.zgswskfjmc"/>

            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>开票方纳税人状态 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.nsrztdm }}</span> -->
              <popCom :content="detailInfo.nsrztdm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>纳税人类型标签有效期起 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.yxqq }}</span> -->
              <popCom :content="detailInfo.yxqq"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>纳税人类型标签有效期止 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.yxqz }}</span> -->
              <popCom :content="detailInfo.yxqz"/>

            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>消费税纳税人类型 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.xfsnsrlxdm }}</span> -->
              <popCom :content="detailInfo.xfsnsrlxdm"/>

            </div>
          </el-col>
        </el-row>
      </div>
    </el-card>
    <el-card class="cardWrap">
      <div slot="header" class="clearfix">
        <span>企业财务信息</span>
      </div>
      <div style="width: 100%">
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>财务负责人姓名 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.cwfzrxm }}</span> -->
              <popCom :content="detailInfo.cwfzrxm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>账户名称 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.khhmc }}</span> -->
              <popCom :content="detailInfo.khhmc"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>账号 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.yhzh }}</span> -->
              <popCom :content="detailInfo.yhzh"/>

            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>企业办税人员姓名 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.bsrxm }}</span> -->
              <popCom :content="detailInfo.bsrxm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>新电票试点企业标识 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.xdpsdqybz }}</span> -->
              <popCom :content="detailInfo.xdpsdqybz"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>出口企业分类 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.ckqyfldm }}</span> -->
              <popCom :content="detailInfo.ckqyfldm"/>

            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <div class="qiyeC">
              <span>总分机构类型 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.zfjglxdm }}</span> -->
              <popCom :content="detailInfo.zfjglxdm"/>

            </div>
          </el-col>
          <el-col :span="8">
            <div class="qiyeC">
              <span>银行营业网点 ：</span>
              <!-- <span class="colorGray">{{ detailInfo.yhyywddm }}</span> -->
              <popCom :content="detailInfo.yhyywddm"/>

            </div>
          </el-col>
        </el-row>
      </div>
    </el-card>
  </div>
</template>

<script>
import { getInfos, addInfos } from '@/api/vmsEnterpriseInfo';
import popCom from "@/components/popCom.vue"

export default {
  name: 'baseInfo',
  data() {
    return {
      loading: false,
      detailInfo: {},
    }
  },
  created() {
    this.initInfo()
  },
  components:{
    popCom
  },
  methods: {
    async initInfo() {
      this.loading = true;
      let {data, code, message} = await getInfos(
          {}
      );
      if (code == 200) {
        this.detailInfo = data

      } else {

        // this.$message({
        //   type: 'success',
        //   message: message,
        // })
      }
      this.loading = false;
    },
    getInfo() {
      this.$alert('是否调用接口获取纳税人基本信息？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        showCancelButton: true,
        type: 'warning',
      })
          .then(async () => {
            this.loading = true;
            let {code, message} = await addInfos(
                {}
            );
            if (code == 200) {
              await this.initInfo()
            } else {
              // this.$message({
              //   type: 'success',
              //   message: message,
              // })
            }
            this.loading = false;
          })
          .catch(() => {
            this.$message({
              type: 'info',
              message: '已取消',
            })
          })
    },
  },
}
</script>

<style lang="scss" scoped>
.baseInfoWrap {
  .cardWrap {
    margin-bottom: 20px;
  }

  .qiyeC {
    overflow: hidden;
    white-space: nowrap;
    margin: 0 20px 10px 0;
    width: 100%;
    display: flex;
    display: -ms-flexbox;
    span:nth-child(1) {
      display: block;
      }
  }

  &:last-child {
    margin: 0 0px 10px 0;
  }

  .colorGray {
    color: #909399;
  }
}

</style>
  